<html>
<head>
<title>Main.java</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
.s0 { color: #cf8e6d;}
.s1 { color: #bcbec4;}
.s2 { color: #bcbec4;}
.s3 { color: #7a7e85;}
.s4 { color: #6aab73;}
.s5 { color: #2aacb8;}
</style>
</head>
<body bgcolor="#1e1f22">
<table CELLSPACING=0 CELLPADDING=5 COLS=1 WIDTH="100%" BGCOLOR="#606060" >
<tr><td><center>
<font face="Arial, Helvetica" color="#000000">
Main.java</font>
</center></td></tr></table>
<pre><span class="s0">public class </span><span class="s1">Main </span><span class="s2">{</span>
    <span class="s0">public static void </span><span class="s1">main</span><span class="s2">(</span><span class="s1">String</span><span class="s2">[] </span><span class="s1">args</span><span class="s2">) {</span>
        <span class="s3">// 创建电脑实例</span>
        <span class="s1">Computer computer1 </span><span class="s2">= </span><span class="s0">new </span><span class="s1">Computer</span><span class="s2">(</span><span class="s4">&quot;Intel i5&quot;</span><span class="s2">, </span><span class="s5">16</span><span class="s2">, </span><span class="s5">512</span><span class="s2">);</span>
        <span class="s1">Computer computer2 </span><span class="s2">= </span><span class="s0">new </span><span class="s1">Computer</span><span class="s2">(</span><span class="s4">&quot;AMD Ryzen 7&quot;</span><span class="s2">, </span><span class="s5">32</span><span class="s2">, </span><span class="s5">1024</span><span class="s2">);</span>
        <span class="s1">Computer computer3 </span><span class="s2">= </span><span class="s0">new </span><span class="s1">Computer</span><span class="s2">(</span><span class="s4">&quot;Intel i7&quot;</span><span class="s2">, </span><span class="s5">16</span><span class="s2">, </span><span class="s5">256</span><span class="s2">);</span>

        <span class="s3">// 创建学生实例</span>
        <span class="s1">Student student1 </span><span class="s2">= </span><span class="s0">new </span><span class="s1">Student</span><span class="s2">(</span><span class="s4">&quot;Alice&quot;</span><span class="s2">, </span><span class="s1">computer1</span><span class="s2">);</span>
        <span class="s1">Student student2 </span><span class="s2">= </span><span class="s0">new </span><span class="s1">Student</span><span class="s2">(</span><span class="s4">&quot;Bob&quot;</span><span class="s2">, </span><span class="s1">computer2</span><span class="s2">);</span>
        <span class="s1">Student student3 </span><span class="s2">= </span><span class="s0">new </span><span class="s1">Student</span><span class="s2">(</span><span class="s4">&quot;Charlie&quot;</span><span class="s2">, </span><span class="s1">computer3</span><span class="s2">);</span>

        <span class="s3">// 输出每个学生的电脑配置</span>
        <span class="s1">student1</span><span class="s2">.</span><span class="s1">printComputerInfo</span><span class="s2">();</span>
        <span class="s1">student2</span><span class="s2">.</span><span class="s1">printComputerInfo</span><span class="s2">();</span>
        <span class="s1">student3</span><span class="s2">.</span><span class="s1">printComputerInfo</span><span class="s2">();</span>
    <span class="s2">}</span>
<span class="s2">}</span></pre>
</body>
</html>